package com.example.filestorage.starter;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "file.storage")
public class FileStorageProperties {
    
    /**
     * 存储类型 (minio 或 rustfs)
     */
    private String type = "minio";
    
    /**
     * MinIO配置
     */
    private Minio minio = new Minio();
    
    /**
     * RustFS配置
     */
    private Rustfs rustfs = new Rustfs();
    
    public static class Minio {
        private String endpoint = "http://localhost:9000";
        private String accessKey = "minioadmin";
        private String secretKey = "minioadmin";
        private String bucketName = "file-storage";
        private boolean enabled = true;
        
        // Getters and Setters
        public String getEndpoint() {
            return endpoint;
        }
        
        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }
        
        public String getAccessKey() {
            return accessKey;
        }
        
        public void setAccessKey(String accessKey) {
            this.accessKey = accessKey;
        }
        
        public String getSecretKey() {
            return secretKey;
        }
        
        public void setSecretKey(String secretKey) {
            this.secretKey = secretKey;
        }
        
        public String getBucketName() {
            return bucketName;
        }
        
        public void setBucketName(String bucketName) {
            this.bucketName = bucketName;
        }
        
        public boolean isEnabled() {
            return enabled;
        }
        
        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
    }
    
    public static class Rustfs {
        private String endpoint = "http://localhost:9000";
        private String accessKey = "rustfsadmin";
        private String secretKey = "rustfsadmin";
        private String bucketName = "file-storage";
        private boolean enabled = false;
        
        // Getters and Setters
        public String getEndpoint() {
            return endpoint;
        }
        
        public void setEndpoint(String endpoint) {
            this.endpoint = endpoint;
        }
        
        public String getAccessKey() {
            return accessKey;
        }
        
        public void setAccessKey(String accessKey) {
            this.accessKey = accessKey;
        }
        
        public String getSecretKey() {
            return secretKey;
        }
        
        public void setSecretKey(String secretKey) {
            this.secretKey = secretKey;
        }
        
        public String getBucketName() {
            return bucketName;
        }
        
        public void setBucketName(String bucketName) {
            this.bucketName = bucketName;
        }
        
        public boolean isEnabled() {
            return enabled;
        }
        
        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
    }
    
    // Getters and Setters
    public String getType() {
        return type;
    }
    
    public void setType(String type) {
        this.type = type;
    }
    
    public Minio getMinio() {
        return minio;
    }
    
    public void setMinio(Minio minio) {
        this.minio = minio;
    }
    
    public Rustfs getRustfs() {
        return rustfs;
    }
    
    public void setRustfs(Rustfs rustfs) {
        this.rustfs = rustfs;
    }
}